home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 28
/
Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso
/
Aminet
/
dev
/
lang
/
fpcsrc.lha
/
fpc
/
compiler
/
globals.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-09-24
|
37KB
|
1,307 lines
{
$Id: globals.pas,v 1.6.2.7 1998/08/18 13:41:22 carl Exp $
Copyright (C) 1993-98 by Florian Klaempfl
This unit implements some support functions and global variables
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
****************************************************************************
}
{$ifdef tp}
{$E+,N+}
{$endif}
unit globals;
interface
uses
cobjects,objects,dos,strings
{$ifdef linux}
,linux
{$endif}
;
{$I version.inc}
type
{ later moved to system unit }
aword = longint;
{ for each processor define the best precision }
{$ifdef i386}
{$ifdef ver_above0_9_8}
bestreal = extended;
{$else ver_above0_9_8}
bestreal = double;
{$endif ver_above0_9_8}
{$endif i386}
{$ifdef m68k}
bestreal = real;
{$endif m68k}
const
{ version string }
version_nr = '0';
release_nr = '99';
patch_nr = '5';
{$ifdef i386}
target = 'i386';
{$endif}
{$ifdef m68k}
target = 'M680x0';
{$endif}
{$ifdef alpha}
target = 'Alpha';
{$endif}
version_string = version_nr+'.'+release_nr+'.'+patch_nr+' for '+target;
{$ifdef Splitheap}
testsplit : boolean = false;
{$endif Splitheap}
{ max. significant length of strings }
maxidlen = 64;
type
{ I had to change the order for overloading
can this be a problem ? (PM)
It will be no problem, if you change also the array to convert
tokens to strings (in PARSER.PAS) (FK)
}
{***IMPLIBGEN}
ttoken = (PLUS,MINUS,STAR,SLASH,EQUAL,GT,LT,GTE,LTE,_IS,_AS,_IN,
SYMDIF,CARET,
ASSIGNMENT,UNEQUAL,LECKKLAMMER,RECKKLAMMER,
POINT,COMMA,LKLAMMER,RKLAMMER,COLON,SEMICOLON,
KLAMMERAFFE,POINTPOINT,
ID,REALNUMBER,_EOF,INTCONST,CSTRING,CCHAR,DOUBLEADDR,
{ _ABSOLUTE,}
_AND,_ARRAY,_ASM,_BEGIN,
_BREAK,_CASE,_CONST,_CONSTRUCTOR,_CONTINUE,
_DESTRUCTOR,_DISPOSE,_DIV,_DO,_DOWNTO,_ELSE,_END,
_EXIT,
{ _EXPORT,}
_EXTERNAL,_FAIL,_FALSE,
{ _FAR,}
_FILE,_FOR,
{ _FORWARD,}
_FUNCTION,_GOTO,_IF,_IMPLEMENTATION,
_INHERITED,
{ _INLINE,}
_INTERFACE,
{ _INTERRUPT,}
_LABEL,_MOD,
{ _NEAR,}
_NEW,_NIL,_NOT,_OBJECT,
_OF,_OTHERWISE,_OR,_PACKED,
_PROCEDURE,_PROGRAM,
_RECORD,_REPEAT,_SELF,
_SET,_SHL,_SHR,_STRING,_THEN,_TO,
_TRUE,_TYPE,_UNIT,_UNTIL,
_USES,_VAR,_WHILE,_WITH,_XOR,
{ since Delphi 2 }
_CLASS,_EXCEPT,_TRY,_ON,
{ _ABSTRACT,}
_LIBRARY,_INITIALIZATION,_FINALLY,_EXPORTS,_PROPERTY,
_RAISE,
{ for operator overloading }
_OPERATOR,
{ C like operators }
_PLUSASN,_MINUSASN,_ANDASN,_ORASN,_STARASN,_SLASHASN,
_MODASN,_DIVASN,_NOTASN,_XORASN
);
tcswitch = (cs_none,
cs_check_overflow,cs_maxoptimieren,cs_uncertainopts,
cs_omitstackframe,cs_littlesize,cs_optimize,cs_debuginfo,
cs_compilesystem,cs_rangechecking,cs_support_goto,
cs_check_unit_name,cs_iocheck,cs_checkconsname,
cs_check_stack,cs_extsyntax,cs_typed_addresses,
cs_delphi2_compatible,cs_tp_compatible,cs_static_keyword,
cs_strict_var_strings,cs_fp_emulation,
{$ifdef SUPPORT_MMX}
cs_mmx,cs_mmx_saturation,
{$endif SUPPORT_MMX}
cs_profile,
cs_link_dynamic,cs_link_static,cs_no_linking,cs_unit_to_lib,
cs_shared_lib,cs_load_objpas_unit);
tcswitches = set of tcswitch;
pcswitches = ^tcswitches;
stringid = string[maxidlen];
pdouble = ^double;
pbyte = ^byte;
plongint = ^longint;
{$ifdef i386}
tprocessors = (i386,i486,pentium,pentiumpro,pentium2);
{$endif}
{$ifdef m68k}
tprocessors = (MC68000,MC68020);
{$endif}
{$ifdef i386}
tof = (of_none,of_o,of_obj,of_masm,of_att,of_nasm,of_win32);
{$endif}
{$ifdef m68k}
{ the support will start with the following formats :
of_o = amiga/atari/mac native object format
of_gas = gas styled motorola assembler
of_mot = motorola styled assembler
of_mit = MIT syntax (old styled gas)
}
tof = (of_none,of_o,of_gas,of_mot,of_mit);
{$endif}
tcompilerstate = record
switches : tcswitches;
exprlevel : byte;
end;
{ this type will be sent from the compiler to the IDE to make up a }
{ status window }
tcompilestatus = record
{ filename }
currentsource : string;
{ current line number }
currentline : longint;
{ will implement a percentage bar }
{ the number of lines which are compiled }
totalcompiledlines : longint;
{ Note: }
{ it's possible that totallines is zero, }
{ this means the compiler didn't know the }
{ total lines }
totallines : longint;
end;
{ such a procedure is called from the compiler, }
{ to put some informations to the ide etc. }
{ if the function returns true, the compiler }
{ stops }
tcompilestatusproc = function(const status : tcompilestatus) : boolean;
{$ifdef i386}
ti386asmmode = (I386_ATT,I386_INTEL,I386_DIRECT);
const
{ the current mode which is in assembler blocks assumed }
aktasmmode : ti386asmmode = I386_DIRECT;
{$endif}
var
compilestatusproc : tcompilestatusproc;
inputdir : dirstr;
inputfile : namestr;
inputextension : extstr;
{ some flags for global compiler switches }
use_pipe,
do_build,do_make,writeasmfile,externasm,externlink : boolean;
assem_need_external_list,not_unit_proc : boolean;
{ path for searching units, different paths can be seperated by ; }
exepath : dirstr; { Path to ppc }
unitsearchpath,
objectsearchpath,
includesearchpath,
librarysearchpath : string;
initswitches : tcswitches;
{ alignement of records }
initpackrecords : word;
{ current state state }
aktswitches : Tcswitches;
aktpackrecords : word;
{ this list contains the defines }
{ from the command line, this defines }
commandlinedefines : tlinkedlist;
abslines : longint; { number of lines which are compiled }
in_args : boolean; { arguments must be checked especially }
parsing_para_level : longint; { parameter level, used to convert
proc calls to proc loads in firstcalln }
Must_be_valid : boolean; { should the variable already have a value }
{$ifdef TP}
use_big : boolean;
{$ifndef dpmi}
symbolstream : temsstream; { stream which is used to store some }
{ informtions to u